from tqsdk import TqApi, TqAuth

async def demo():
    quote = api.get_quote("SHFE.cu2510")
    async with api.register_update_notify(quote) as update_chan:
        async for _ in update_chan:
            i=0
            while True:
                print(i)
                i+=1
                print(quote.last_price)

api = TqApi(auth=TqAuth("cps168", "alibaba999"))
api.create_task(demo())

while True:
    api.wait_update()
